# Contributor: Francesco Colista <francesco.colista@gmail.com>
# Maintainer: Francesco Colista <francesco.colista@gmail.com>
pkgname=perl-libapreq2
_pkgreal=libapreq2
pkgver=2.13
pkgrel=8
pkgdesc="Perl module for libapreq2"
url="https://metacpan.org/release/libapreq2/"
arch="all"
license="GPL PerlArtistic"
depends="apache2 perl"
subpackages="$pkgname-dev $pkgname-doc"
install="$pkgname.post-install"
makedepends="perl-extutils-xsbuilder perl-dev libtool apache2-dev apache2-mod-perl-dev expat-dev apr-util-dev"
source="https://cpan.metacpan.org/authors/id/I/IS/ISAAC/$_pkgreal-$pkgver.tar.gz
	libapreq2-2.08-doc.patch
	$pkgname.conf"

builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare
	update_config_guess
}

build() {
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL \
		--with-apache2-apxs=/usr/bin/apxs \
		--with-apache2-httpd=/usr/sbin/httpd
	make
}

package() {
	make DESTDIR="$pkgdir" INSTALLDIRS="vendor" install
	install -Dm644 "$srcdir"/$pkgname.conf \
		"$pkgdir"/etc/apache2/conf.d/perl-libapreq2.conf
	find "$pkgdir" -name mod_apreq2.la -delete
	find "$pkgdir" -name libapreq2.la -delete
}

sha512sums="54553cb90c0d3f6fb34ff19364c5804976c4aff1bae551ae051fdd06f41695770f1e285c40e03dbd93ae738adc332f38f1a1994167598364071feaec833fdf05  libapreq2-2.13.tar.gz
dc889d7890d9059efdb3fcd4d6b1e485929b69c073ff6266b90f82e89efe5bdd633fd4dc09ccd4aac3f8816271c00dca69b39ffe4706baf7d3094404784cd766  libapreq2-2.08-doc.patch
e7fa4f3b51cbc6417369ba171ac0fb955ec0cd6d3575e07e7451ef2a8165d24ddbbcc3143a5c8106a757ecd7d4286a11a9ff87e27c1acff8abc48110fcb02e1f  perl-libapreq2.conf"
